/*=============================================================================
*
*   Copyright (C) 2020 All rights reserved.
*
*   Filename:		test_material.cpp
*
*   Author: Wang Zhecheng - wangzhecheng@yeah.net
*
*   Date: 2020-02-21 00:25
*
*   Last Editors: Wang Zhecheng - wangzhecheng@yeah.net
*
*   Last modified:	2020-03-24 03:25
*
*   Description:
*
=============================================================================*/

#include "../include/util/factory.hpp"
#include <iostream>

/* #define TEST_SHAPE */
#define TEST_MAT

#ifdef TEST_MAT

#include "../include/material/Elastic.hpp"

using namespace geoxfem::material;
using namespace geoxfem::model;

int main() {
  using ptree = boost::property_tree::ptree;

  MaterialInterface<plane_stress>::factory fac;
  MaterialInterface<plane_stress>::factory::registrator<Elastic<plane_stress>>
                                         reg1(fac);
  std::unique_ptr<Elastic<plane_stress>> e =
    std::make_unique<Elastic<plane_stress>>(ptree());

  std::unique_ptr<MaterialInterface<plane_stress>> e1 =
    fac.create("Elastic", ptree());

  std::cout << *e << std::endl;
  std::cout << *e1 << std::endl;
  return 0;
}

#endif

#ifdef TEST_SHAPE

#include "../../include/geometry/shape/Vertex.hpp"

using namespace geoxfem::geometry;

int main() {

  IShape<Point<2>>::factory                                fac;
  IShape<Point<2>>::factory::registrator<Vertex<Point<2>>> reg1(fac);

  Point2D p1;
  p1.setIndex(123);
  std::unique_ptr<IShape<Point<2>>> v = fac.create("Vertex", {p1}, nullptr);

  std::cout << *v << std::endl;
  return 0;
}
#endif
